<template>

   <div id="app">
    <router-view ></router-view>


     <mu-toast v-if="showToast" :message="toastMessage" @close="_closeToast"/>
     <image-viewer
       :show="showImagePopup"
       @close="closeImagePopup">
       <img :src="displayedImage" class="displayed-image">
     </image-viewer>
  </div>
</template>

<script>
  import store from './store/store'
  import ImageViewer from './components/ImageViewer'
export default {
  name: 'app',
  components:{
    ImageViewer
  },
  data () {
    return {
      bottomNav: 'recents'
    }
  },
  mounted(){
	//获取版本号注释
	//为了实现微信免登陆暂时关闭 2018-3-19 10:45
//this.axios.get('static/version/version.js?t='+new Date().getTime()).then(function(response){
//    let version=response.data
//      if(window.localStorage.version!=version){
//        window.localStorage.version=version
//        window.location.href='index.html?t='+version+"/#/login"
//      }
//    }).catch(function(error){
//    	console.log(error)
//    })
},
  computed:{
    showToast:()=>store.state.showToast,
    toastMessage:()=>store.state.toastMessage,

    showImagePopup:()=>store.state.showImagePopup,
    displayedImage:()=>store.state.displayedImage
  },
  methods: {
    handleChange (val) {
      this.bottomNav = val
    },
    _closeToast(){
      store.commit('closeToast')
    },
    closeImagePopup(){
      store.commit('closeImagePopup')

    }
  }
}
</script>
<style>
  .displayed-image{
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
</style>
